<?php

namespace Home\Controller;
use Home\Controller\BaseController;
class ApplyDetailController extends BaseController{
    public function index(){
        $apply_id = $_GET['id'];


        $where['id']=$apply_id;
        $result = M('apply')->where($where)->select();
        $count = count($result);

        $Page = new \Think\Page($count, 5);

        foreach ($where as $key => $val) {
            $Page->parameter[$key] = urlencode($val);
        }
        $Page->setConfig('next', '上一页');
        $Page->setConfig('prev', '下一页');
        $show = $Page->show();

        var_dump($where);

        $applyDetail = M('apply')->where($where)->order('id desc')->limit($Page->firstRow . ',' . $Page->listRows)->select();

        $this->assign('count', $count);
        $this->assign('show', $show);
        $this->assign('applyDetail', $applyDetail);


//        列表数据处理结束
        $this->display('teacher/applyDetail');
    }
}